#include <iostream>
#include "Expression.h"
//#include "MonVisiteurInutile.h"
#include "PrettyPrinter.h"
#include "PrettyPrinterInstruction.h"

using namespace std;
using namespace COOLangage;

int main()
{
	cout << "Presentation des visiteurs!" << endl;

	PrettyPrinter print = PrettyPrinter();
	PrettyPrinterInstruction p = PrettyPrinterInstruction();

	Type * entier1 = new Type("int");
	Variable * x = new Variable("x");
	Variable * y = new Variable("y");
	DeclarationVariable * va = new DeclarationVariable(entier1, x);

	Instruction * leIf = new DeclarationVariable(entier1, x);
	Instruction * blocIf = new Bloc(va);
	Instruction * leElse = new DeclarationVariable(entier1, x);
	Instruction * blocElse = new Bloc(va);
	Expression * exp1 = new OperateurBinaire("==", x, y) ;
	Conditionnelle * cond1 = new Conditionnelle(exp1, blocIf, blocElse);

	Appel a("main");

	Litteral<char> lc('3');
	LitEntier entier(34);
	//Operateur operateur("+");
	OperateurUnaire unaire("!", new LitEntier(3));
	OperateurBinaire binaire("*",new LitEntier(2), new LitEntier(4));
	Variable var("toto");
	Variable *var2 =  new Variable("titi");
	a.addArgument(var2);

//	UselessVisitorExpression visitor;
//	a.visit(&visitor);
//	lc.visit(&visitor);
//	entier.visit(&visitor);
//	unaire.visit(&visitor);
//	binaire.visit(&visitor);

	cout << "PRETTYPRINTER" << endl ;

//	Expression *ex = &var;
//	(&var)->visit(&print);
//	cout << endl ;
//	ex->visit(&print);
//	cout << endl ;
//	(&a)->visit(&print);
//	cout << endl ;
//	//(&lc)->visit(&print);
//	cout << endl ;
//	(&entier)->visit(&print);
//	cout << endl ;
//	(&unaire)->visit(&print);
//	cout << endl ;
//	(&binaire)->visit(&print);

	cond1->visit(&p);

	return 0;
}
